<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Class: Sass::Selector::SimpleSequence</title>
<link rel="stylesheet" href="style.css" tppabs="http://sass-lang.com/docs/yardoc/css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="common.css" tppabs="http://sass-lang.com/docs/yardoc/css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="jquery.js" tppabs="http://sass-lang.com/docs/yardoc/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js" tppabs="http://sass-lang.com/docs/yardoc/js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="_index.html" tppabs="http://sass-lang.com/docs/yardoc/_index.html">Index (S)</a> &raquo; 
    <span class='title'><a href="Sass-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass.html" title="Sass (module)">Sass</a></span> &raquo; <span class='title'><a href="Selector.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector.html" title="Sass::Selector (module)">Selector</a></span>
     &raquo; 
    <span class="title">SimpleSequence</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="javascript:if(confirm(%27http://sass-lang.com/docs/yardoc/Sass/Selector/.  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?%27))window.location=%27http://sass-lang.com/docs/yardoc/Sass/Selector/.%27" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Sass::Selector::SimpleSequence 
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><a href="AbstractSequence.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/AbstractSequence.html" title="Sass::Selector::AbstractSequence (class)">AbstractSequence</a></span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next"><a href="AbstractSequence.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/AbstractSequence.html" title="Sass::Selector::AbstractSequence (class)">AbstractSequence</a></li>
          
            <li class="next">Sass::Selector::SimpleSequence</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">/var/www/sass-pages/.sass/lib/sass/selector/simple_sequence.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>A unseparated sequence of selectors that all apply to a single element. For example, <code>.foo#bar[attr=baz]</code> is a simple sequence of the selectors <code>.foo</code>, <code>#bar</code>, and <code>[attr=baz]</code>.</p>

  </div>
</div>
<div class="tags">
  
</div>

  
  
  
  
  <h2>Instance Attribute Summary</h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#members-instance_method" title="#members (instance method)">- (Array&lt;Simple&gt;) <strong>members</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  

  
    <span class="summary_desc">The array of individual selectors.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#sources-instance_method" title="#sources (instance method)">- (Set&lt;Sequence&gt;) <strong>sources</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  

  
    <span class="summary_desc">The extending selectors that caused this selector sequence to be generated.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#subject%3D-instance_method" title="#subject= (instance method)">- <strong>subject</strong> </a>
    

    
  </span>
  
  
    
    <span class="note title writeonly">writeonly</span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
  </ul>


  <h2>Instance Method Summary</h2>

  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#base-instance_method" title="#base (instance method)">- (Element, ...) <strong>base</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns the element or universal selector in this sequence, if it exists.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#do_extend-instance_method" title="#do_extend (instance method)">- <strong>do_extend</strong>(extends, parent_directives) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Non-destrucively extends this selector with the extensions specified in a hash (which should come from <tt><a href="Cssize.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/Cssize.html" title="Sass::Tree::Visitors::Cssize (class)">Sass::Tree::Visitors::Cssize</a></tt>).</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (SimpleSequence) <strong>initialize</strong>(selectors, subject, sources = Set.new) </a>
    

    
  </span>
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  

  
    <span class="summary_desc">A new instance of SimpleSequence.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#inspect-instance_method" title="#inspect (instance method)">- (String) <strong>inspect</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns a string representation of the sequence.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#resolve_parent_refs-instance_method" title="#resolve_parent_refs (instance method)">- (Array&lt;SimpleSequence&gt;) <strong>resolve_parent_refs</strong>(super_seq) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Resolves the <tt><a href="Parent.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Parent.html" title="Sass::Selector::Parent (class)">Parent</a></tt> selectors within this selector by replacing them with the given parent selector, handling commas appropriately.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#rest-instance_method" title="#rest (instance method)">- (Set&lt;Simple&gt;) <strong>rest</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns the non-base selectors in this sequence.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#subject%3F-instance_method" title="#subject? (instance method)">- (Boolean) <strong>subject?</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Whether or not this compound selector is the subject of the parent selector; that is, whether it is prepended with <code>$</code> and represents the actual element that will be selected.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#superselector%3F-instance_method" title="#superselector? (instance method)">- (Boolean) <strong>superselector?</strong>(sseq) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns whether or not this selector matches all elements that the given selector matches (as well as possibly more).</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#to_a-instance_method" title="#to_a (instance method)">- <strong>to_a</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#unify-instance_method" title="#unify (instance method)">- (SimpleSequence<sup>?</sup>) <strong>unify</strong>(sels, other_subject) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Unifies this selector with another <tt><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></tt>&#8217;s <tt><a href="#members-instance_method" title="Sass::Selector::SimpleSequence#members (method)">members array</a></tt>, returning another <code>SimpleSequence</code> that matches both this selector and the input selector.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#with_more_sources-instance_method" title="#with_more_sources (instance method)">- (SimpleSequence) <strong>with_more_sources</strong>(sources) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Return a copy of this simple sequence with <code>sources</code> merged into the set.</span>
  
</li>

    
  </ul>

  
  
  
  
  
  <h3 class="inherited">Methods inherited from <a href="AbstractSequence.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/AbstractSequence.html" title="Sass::Selector::AbstractSequence (class)">AbstractSequence</a></h3>
  <p class="inherited"><a href="AbstractSequence.html#_specificity-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/AbstractSequence.html#_specificity-instance_method" title="Sass::Selector::AbstractSequence#_specificity (method)">#_specificity</a>, <a href="AbstractSequence.html#eql%3F-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/AbstractSequence.html#eql%3F-instance_method" title="Sass::Selector::AbstractSequence#eql? (method)">#eql?</a>, <a href="AbstractSequence.html#has_placeholder%3F-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/AbstractSequence.html#has_placeholder%3F-instance_method" title="Sass::Selector::AbstractSequence#has_placeholder? (method)">#has_placeholder?</a>, <a href="AbstractSequence.html#hash-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/AbstractSequence.html#hash-instance_method" title="Sass::Selector::AbstractSequence#hash (method)">#hash</a>, <a href="AbstractSequence.html#specificity-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/AbstractSequence.html#specificity-instance_method" title="Sass::Selector::AbstractSequence#specificity (method)">#specificity</a>, <a href="AbstractSequence.html#to_s-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/AbstractSequence.html#to_s-instance_method" title="Sass::Selector::AbstractSequence#to_s (method)">#to_s</a></p>
<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></tt>) <strong>initialize</strong>(selectors, subject, sources = Set.new) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>A new instance of SimpleSequence</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<a href="Simple.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Simple.html" title="Sass::Selector::Simple (class)">Simple</a>&gt;</tt>)</span>
      
      
        <span class='name'>selectors</span>
      
      
      
        &mdash;
        See <tt><a href="#members-instance_method" title="Sass::Selector::SimpleSequence#members (method)">#members</a></tt>
      
    </li>
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
        <span class='name'>subject</span>
      
      
      
        &mdash;
        See <tt><a href="#subject%3F-instance_method" title="Sass::Selector::SimpleSequence#subject? (method)">#subject?</a></tt>
      
    </li>
  
    <li>
      
        <span class='type'>(<tt>Set&lt;<a href="Sequence.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Sequence.html" title="Sass::Selector::Sequence (class)">Sequence</a>&gt;</tt>)</span>
      
      
        <span class='name'>sources</span>
      
      
        <em class="default">(defaults to: <tt>Set.new</tt>)</em>
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


59
60
61
62
63</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/simple_sequence.rb', line 59</span>

def initialize(selectors, subject, sources = Set.new)
  @members = selectors
  @subject = subject
  @sources = sources
end</pre>
    </td>
  </tr>
</table>
</div>
  
</div>

  <div id="instance_attr_details" class="attr_details">
    <h2>Instance Attribute Details</h2>
    
      
      <span id="members=-instance_method"></span>
      <span id="members-instance_method"></span>
      <div class="method_details first">
  <p class="signature first" id="members-instance_method">
  
    - (<tt>Array&lt;<a href="Simple.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Simple.html" title="Sass::Selector::Simple (class)">Simple</a>&gt;</tt>) <strong>members</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The array of individual selectors.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<a href="Simple.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Simple.html" title="Sass::Selector::Simple (class)">Simple</a>&gt;</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


11
12
13</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/simple_sequence.rb', line 11</span>

def members
  @members
end</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="sources=-instance_method"></span>
      <span id="sources-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="sources-instance_method">
  
    - (<tt>Set&lt;<a href="Sequence.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Sequence.html" title="Sass::Selector::Sequence (class)">Sequence</a>&gt;</tt>) <strong>sources</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The extending selectors that caused this selector sequence to be generated. For example:</p>

<pre class="code">a.foo { ... }
b.bar {@extend a}
c.baz {@extend b}</pre>

<p>The generated selector <code>b.foo.bar</code> has <code>{b.bar}</code> as its <code>sources</code> set, and the generated selector <code>c.foo.bar.baz</code> has <code>{b.bar, c.baz}</code> as its <code>sources</code> set.</p>

<p>This is populated during the process.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Set&lt;<a href="Sequence.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Sequence.html" title="Sass::Selector::Sequence (class)">Sequence</a>&gt;</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


27
28
29</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/simple_sequence.rb', line 27</span>

def sources
  @sources
end</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="subject=-instance_method"></span>
      <span id=""></span>
      <div class="method_details ">
  <p class="signature " id="subject=-instance_method">
  
    - <strong>subject=</strong>(value)  <span class="extras">(writeonly)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
  <h3>See Also:</h3>
  <ul class="see">
    
      <li>\{#subject?}</li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


30
31
32</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/simple_sequence.rb', line 30</span>

def subject=(value)
  @subject = value
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>


  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="base-instance_method">
  
    - (<tt><a href="Element.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Element.html" title="Sass::Selector::Element (class)">Element</a></tt>, ...) <strong>base</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the element or universal selector in this sequence, if it exists.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Element.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Element.html" title="Sass::Selector::Element (class)">Element</a></tt>, <tt><a href="Universal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Universal.html" title="Sass::Selector::Universal (class)">Universal</a></tt>, <tt>nil</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


36
37
38</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/simple_sequence.rb', line 36</span>

def base
  @base ||= (members.first if members.first.is_a?(Element) || members.first.is_a?(Universal))
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="do_extend-instance_method">
  
    - <strong>do_extend</strong>(extends, parent_directives) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Non-destrucively extends this selector with the extensions specified in a hash (which should come from <tt><a href="Cssize.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/Cssize.html" title="Sass::Tree::Visitors::Cssize (class)">Sass::Tree::Visitors::Cssize</a></tt>).</p>

  </div>
</div>
<div class="tags">
  
  
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>{<a href="Simple.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Simple.html" title="Sass::Selector::Simple (class)">Selector::Simple</a> =&gt; <a href="Extend.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/Cssize/Extend.html" title="Sass::Tree::Visitors::Cssize::Extend (class)">Sass::Tree::Visitors::Cssize::Extend</a>}</tt>)</span>
      
      
        <span class='name'>extends</span>
      
      
      
        &mdash;
        The extensions to perform on this selector
      
    </li>
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<a href="DirectiveNode.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/DirectiveNode.html" title="Sass::Tree::DirectiveNode (class)">Sass::Tree::DirectiveNode</a>&gt;</tt>)</span>
      
      
        <span class='name'>parent_directives</span>
      
      
      
        &mdash;
        The directives containing this selector.
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<a href="Sequence.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Sequence.html" title="Sass::Selector::Sequence (class)">Sequence</a>&gt;</tt>)</span>
      
      
      
      
        &mdash;
        A list of selectors generated by extending this selector with <code>extends</code>.
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="CommaSequence.html#do_extend-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/CommaSequence.html#do_extend-instance_method" title="Sass::Selector::CommaSequence#do_extend (method)">CommaSequence#do_extend</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/simple_sequence.rb', line 98</span>

def do_extend(extends, parent_directives, seen = Set.new)
  Sass::Util.group_by_to_a(extends.get(members.to_set)) {|ex, _| ex.extender}.map do |seq, group|
    sels = group.map {|_, s| s}.flatten
    # If A {@extend B} and C {...},
    # seq is A, sels is B, and self is C

    self_without_sel = Sass::Util.array_minus(self.members, sels)
    group.each {|e, _| e.result = :failed_to_unify unless e.result == :succeeded}
    next unless unified = seq.members.last.unify(self_without_sel, subject?)
    group.each {|e, _| e.result = :succeeded}
    next if group.map {|e, _| check_directives_match!(e, parent_directives)}.none?
    new_seq = Sequence.new(seq.members[0...-1] + [unified])
    new_seq.add_sources!(sources + [seq])
    [sels, new_seq]
  end.compact.map do |sels, seq|
    seen.include?(sels) ? [] : seq.do_extend(extends, parent_directives, seen + [sels])
  end.flatten.uniq
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="inspect-instance_method">
  
    - (<tt>String</tt>) <strong>inspect</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns a string representation of the sequence. This is basically the selector string.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


162
163
164</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/simple_sequence.rb', line 162</span>

def inspect
  members.map {|m| m.inspect}.join
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="resolve_parent_refs-instance_method">
  
    - (<tt>Array&lt;<a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a>&gt;</tt>) <strong>resolve_parent_refs</strong>(super_seq) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Resolves the <tt><a href="Parent.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Parent.html" title="Sass::Selector::Parent (class)">Parent</a></tt> selectors within this selector by replacing them with the given parent selector, handling commas appropriately.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Sequence.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Sequence.html" title="Sass::Selector::Sequence (class)">Sequence</a></tt>)</span>
      
      
        <span class='name'>super_seq</span>
      
      
      
        &mdash;
        The parent selector sequence
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a>&gt;</tt>)</span>
      
      
      
      
        &mdash;
        This selector, with parent references resolved. This is an array because the parent selector is itself a <tt><a href="Sequence.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Sequence.html" title="Sass::Selector::Sequence (class)">Sequence</a></tt>
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt><a href="SyntaxError.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/SyntaxError.html" title="Sass::SyntaxError (class)">Sass::SyntaxError</a></tt>)</span>
      
      
      
      
        &mdash;
        If a parent selector is invalid
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


73
74
75
76
77
78
79
80
81
82
83
84</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/simple_sequence.rb', line 73</span>

def resolve_parent_refs(super_seq)
  # Parent selector only appears as the first selector in the sequence
  return [self] unless @members.first.is_a?(Parent)

  return super_seq.members if @members.size == 1
  unless super_seq.members.last.is_a?(SimpleSequence)
    raise Sass::SyntaxError.new("Invalid parent selector: " + super_seq.to_a.join)
  end

  super_seq.members[0...-1] +
    [SimpleSequence.new(super_seq.members.last.members + @members[1..-1], subject?)]
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="rest-instance_method">
  
    - (<tt>Set&lt;<a href="Simple.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Simple.html" title="Sass::Selector::Simple (class)">Simple</a>&gt;</tt>) <strong>rest</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the non-base selectors in this sequence.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Set&lt;<a href="Simple.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Simple.html" title="Sass::Selector::Simple (class)">Simple</a>&gt;</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


43
44
45</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/simple_sequence.rb', line 43</span>

def rest
  @rest ||= Set.new(base ? members[1..-1] : members)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="subject?-instance_method">
  
    - (<tt>Boolean</tt>) <strong>subject?</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Whether or not this compound selector is the subject of the parent selector; that is, whether it is prepended with <code>$</code> and represents the actual element that will be selected.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


52
53
54</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/simple_sequence.rb', line 52</span>

def subject?
  @subject
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="superselector?-instance_method">
  
    - (<tt>Boolean</tt>) <strong>superselector?</strong>(sseq) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns whether or not this selector matches all elements that the given selector matches (as well as possibly more).</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  (.foo).superselector?(.foo.bar) #=> true
  (.foo).superselector?(.bar) #=> false</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></tt>)</span>
      
      
        <span class='name'>sseq</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


147
148
149</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/simple_sequence.rb', line 147</span>

def superselector?(sseq)
  (base.nil? || base.eql?(sseq.base)) && rest.subset?(sseq.rest)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="to_a-instance_method">
  
    - <strong>to_a</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="Simple.html#to_a-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Simple.html#to_a-instance_method" title="Sass::Selector::Simple#to_a (method)">Simple#to_a</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


152
153
154
155
156</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/simple_sequence.rb', line 152</span>

def to_a
  res = @members.map {|sel| sel.to_a}.flatten
  res << '!' if subject?
  res
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="unify-instance_method">
  
    - (<tt><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></tt><sup>?</sup>) <strong>unify</strong>(sels, other_subject) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Unifies this selector with another <tt><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></tt>&#8217;s <tt><a href="#members-instance_method" title="Sass::Selector::SimpleSequence#members (method)">members array</a></tt>, returning another <code>SimpleSequence</code> that matches both this selector and the input selector.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<a href="Simple.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Simple.html" title="Sass::Selector::Simple (class)">Simple</a>&gt;</tt>)</span>
      
      
        <span class='name'>sels</span>
      
      
      
        &mdash;
        A <tt><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></tt>&#8217;s <tt><a href="#members-instance_method" title="Sass::Selector::SimpleSequence#members (method)">members array</a></tt>
      
    </li>
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
        <span class='name'>subject</span>
      
      
      
        &mdash;
        Whether the <tt><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></tt> being merged is a subject.
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></tt>, <tt>nil</tt>)</span>
      
      
      
      
        &mdash;
        A <tt><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></tt> matching both <code>sels</code> and this selector, or <code>nil</code> if this is impossible (e.g. unifying <code>#foo</code> and <code>#bar</code>)
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt><a href="SyntaxError.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/SyntaxError.html" title="Sass::SyntaxError (class)">Sass::SyntaxError</a></tt>)</span>
      
      
      
      
        &mdash;
        If this selector cannot be unified. This will only ever occur when a dynamic selector, such as <tt><a href="Parent.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Parent.html" title="Sass::Selector::Parent (class)">Parent</a></tt> or <tt><a href="Interpolation-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Interpolation.html" title="Sass::Selector::Interpolation (class)">Interpolation</a></tt>, is used in unification. Since these selectors should be resolved by the time extension and unification happen, this exception will only ever be raised as a result of programmer error
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


131
132
133
134
135
136
137</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/simple_sequence.rb', line 131</span>

def unify(sels, other_subject)
  return unless sseq = members.inject(sels) do |sseq, sel|
    return unless sseq
    sel.unify(sseq)
  end
  SimpleSequence.new(sseq, other_subject || subject?)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="with_more_sources-instance_method">
  
    - (<tt><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></tt>) <strong>with_more_sources</strong>(sources) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Return a copy of this simple sequence with <code>sources</code> merged into the set.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Set&lt;<a href="Sequence.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Sequence.html" title="Sass::Selector::Sequence (class)">Sequence</a>&gt;</tt>)</span>
      
      
        <span class='name'>sources</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


171
172
173
174
175
176</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/simple_sequence.rb', line 171</span>

def with_more_sources(sources)
  sseq = dup
  sseq.members = members.dup
  sseq.sources.merge sources
  sseq
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Fri Mar  8 20:33:55 2013 by 
  <a href="javascript:if(confirm(%27http://yardoc.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://yardoc.org/%27" tppabs="http://yardoc.org/" title="Yay! A Ruby Documentation Tool">yard</a>
  0.5.3 (ruby-1.8.7).
</div>


  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-535380-8");
  pageTracker._trackPageview();
  } catch(err) {}</script>


  </body>
</html>